<!--
 * @Author: daidai
 * @Date: 2022-03-04 09:23:59
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-05-07 11:05:02
 * @FilePath: \web-pc\src\pages\big-screen\view\indexs\index.vue
-->
<template>
  <div class="contents">
    <div class="contetn_left">
      <div class="pagetab">
        <el-row>
          <el-col :span="8">
            <span style="color:aqua;font-size: 18px;">公司片区：</span>
          </el-col>
          <el-col :span="16">
            <el-select v-model="area" placeholder="请选择" style="margin-top: -10px;width: 260px;" @change="changeArea">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-col>
        </el-row>
      </div>
      <ItemWrap class="contetn_left-top contetn_lr-item" title="公司预计出库目标达成">
        <!-- <LeftTop /> -->
        <left-top :parent-data="parentData"></left-top>
      </ItemWrap>
      <ItemWrap class="contetn_left-center contetn_lr-item" title="片区预计出库目标达成">
        <!-- <LeftCenter /> -->
         <left-center :parent-data="parentData"></left-center>
      </ItemWrap>
      <ItemWrap class="contetn_left-bottom contetn_lr-item" title="年度接单产品聚焦" style="padding: 0 10px 16px 10px">
        <!-- <LeftBottom /> -->
         <left-bottom :parent-data="parentData"></left-bottom>
      </ItemWrap>
    </div>
    <div class="contetn_center">
      <!--<CenterMap class="contetn_center_top" />-->
      <center-map :parent-data="parentData" :customerInfo="customer" @update-msg="handleUpdateMsg"></center-map>
      <ItemWrap class="contetn_center-bottom" title="当周目标达成">
        <!--<CenterBottom />-->
        <center-bottom :parent-data="parentData"></center-bottom>
      </ItemWrap>
    </div>
    <div class="contetn_right">
      <ItemWrap class="contetn_left-bottom contetn_lr-item" title="片区客户分析">
        <right-top :parent-data="parentData"></right-top>
      </ItemWrap>
      <ItemWrap class="contetn_left-bottom contetn_lr-item" title="片区客户数据" style="padding: 0 10px 16px 10px">
        <right-center :parent-data="parentData" :customerInfo="customer"></right-center>
      </ItemWrap>
      <ItemWrap class="contetn_left-bottom contetn_lr-item" title="客户种植分析 ">
        <right-bottom :parent-data="parentData" :customerInfo="customer"></right-bottom>
      </ItemWrap>
    </div>
  </div>
</template>

<script>
import LeftTop from './left-top.vue'
import LeftCenter from "./left-center.vue";
import LeftBottom from "./left-bottom.vue";
import CenterMap from "./center-map.vue";
import CenterBottom from "./center-bottom.vue";
import RightTop from "./right-top.vue";
import RightCenter from "./right-center.vue";
import RightBottom from "./right-bottom.vue";
import axios from 'axios';

export default {
  components: {
    LeftTop,
    LeftCenter,
    LeftBottom,
    CenterMap,
    RightTop,
    RightCenter,
    RightBottom,
    CenterBottom,
  },
  data() {
    return {
      parentData: "云南上云丰花卉有限公司",
      customer: null,
      options: [],
      area: '云南上云丰花卉有限公司',
      // hostIP: "localhost",
      hostIP: "116.54.4.93",
    };
  },
  filters: {
    numsFilter(msg) {
      return msg || 0;
    },
  },
  created() {
    this.getOrg();
  },

  mounted() {},
  methods: {
    handleUpdateMsg(newVal) {
      this.customer = newVal
    },
    getOrg(){
      axios.get('http://'+this.hostIP+':9500/api/bigscreen/getOrg') // 使用 params 参数传递查询参数
      .then(response => {
        this.options = response.data;
      })
      .catch(error => {
        console.error('请求失败:', error);
      });
    },
    changeArea(){
      this.parentData = this.area;
    }
  },
};
</script>
<style lang="scss" scoped>
// 内容
.contents {
  .contetn_left,
  .contetn_right {
    width: 540px;
    box-sizing: border-box;
    // padding: 16px 0;
  }

  .contetn_center {
    width: 720px;
  }

  //左右两侧 三个块
  .contetn_lr-item {
    height: 310px;
  }

  .contetn_center_top {
    width: 100%;
  }

  // 中间
  .contetn_center {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }

  .contetn_center-bottom {
    height: 315px;
  }

  //左边 右边 结构一样
  .contetn_left,
  .contetn_right {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;

  
  }
}


@keyframes rotating {
    0% {
        -webkit-transform: rotate(0) scale(1);
        transform: rotate(0) scale(1);
    }
    50% {
        -webkit-transform: rotate(180deg) scale(1.1);
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        -webkit-transform: rotate(360deg) scale(1);
        transform: rotate(360deg) scale(1);
    }
}
</style>
